잠시만 기다려 주세요

     '대통령을 욕하는 것은 민주사회에서 주권을 가진 시민의 당연한 권리입니다. 대통령을 욕하는 것으로 주권자가 스트레스를 해소할 수 있다면 저는 기쁜 마음으로 들을 수 있습니다. - 노무현 -'
전체검색 :  
이번주 로또 및 연금번호 발생!!   |  HOME   |  여기는?   |  바다물때표   |  알림 (16)  |  여러가지 팁 (1054)  |  추천 및 재미 (150)  |  자료실 (22)  |  
시사, 이슈, 칼럼, 평론, 비평 (582)  |  끄적거림 (127)  |  문예 창작 (702)  |  바람 따라 (69)  |  시나리오 (760)  |  드라마 대본 (248)  |  
살인!


    postgresql

postgresql - 인덱스 확인, 생성, 삭제, index create, 재인덱싱, 인덱스 사용빈도 확인
이 름 : 바다아이   |   조회수 : 8094         짧은 주소 : https://www.bada-ie.com/su/?941591778368
인덱스 확인


SELECT * FROM pg_indexes WHERE tablename = '테이블이름';


인덱스 생성


CREATE INDEX 인덱스이름 ON 테이블이름 USING btree(컬럼1, 컬럼2);


참고) 여러개 칼럼 묶으시면 왼쪽부터 적용됩니다. 검색시 조건에서 컬럼1 빼고 컬럼2 쪽만 있으면 인덱스 폭망입니다.


만약 UNIQUE 중복금지 지정하려면


CREATE UNIQUE INDEX 인덱스이름 ON 테이블이름 USING btree(컬럼1, 컬럼2);


인덱스 삭제


DROP INDEX 인덱스이름


인덱스 다시 재인덱싱....  (인덱스가 손상될 수가 있습니다. 이때 다시 함)


REINDEX INDEX 인덱스명
REINDEX TABLE 테이블명
REINDEX DATABASE 데이타베이스명



인덱스 사용빈도 확인


select schemaname, relname, indexrelname, idx_scan as idx_scan_cnt from pg_stat_user_indexes order by idx_scan;



p.s
PRIMARY KEY 는 자동으로 생성시 인덱스가 잡힙니다.
또한 자동 UNIQUE 지정됩니다.


 
| |





      1 page / 2 page
번 호 카테고리 제 목 이름 조회수
45 postgresql postgresql ... postgresql 14 .. postgresql.conf port 5432 .. 바다아이 673
44 postgresql , count(*) .... 바다아이 6852
43 postgresql How to do an update + join in PostgreSQL?, 바다아이 6082
42 postgresql sequence(퀀) 바다아이 7715
현재글 postgresql , , , index create, , 바다아이 8095
40 postgresql postgresql log_timezone .... 바다아이 6499
39 postgresql postgresql SEQUENCE reset .... 바다아이 8334
38 postgresql [PostgreSql] WITH , , Operator 바다아이 7728
37 postgresql postgresql for, foreach , 바다아이 9283
36 postgresql postgresql , , into ... 바다아이 9281
35 postgresql postgresql PL/pgSQL - SQL Procedural Language, , 바다아이 10696
34 postgresql postgresql ... .. , , 바다아이 11711
33 postgresql postgresql CSV export/import 바다아이 8512
32 postgresql postgresql tablespace , .... 바다아이 12835
31 postgresql postgresql 10 partitioning, ... , ... 바다아이 9253
30 postgresql Using PostgreSQL Arrays, ... ... 바다아이 9219
29 postgresql PostgreSQL (TRIGGER) (function) 바다아이 8983
28 postgresql Optimize and Improve PostgreSQL Performance with VACUUM, ANALYZE, and REINDEX 바다아이 9631
27 postgresql postgresql tuple . vacuumdb .. , . 바다아이 9029
26 postgresql postgresql , .. 바다아이 9223
25 postgresql postgresql , size, 바다아이 11222
24 postgresql postgresql , , .... 바다아이 8270
23 postgresql PostgreSQL Replication, , , master, slave 바다아이 10770
22 postgresql postgresql case 바다아이 8138
21 postgresql postgresql with 바다아이 8575
20 postgresql postgresql , , string 바다아이 11479
19 postgresql Postgresql partitioning table , , , 바다아이 9072
18 postgresql PostgreSQL 바다아이 10561
17 postgresql postgresql vacuumdb, psql, pg_dump password crontab , pgpass 바다아이 10245
16 postgresql postgresql sequence 퀀 auto_increment . 바다아이 9665
| |









Copyright ⓒ 2001.12. bada-ie.com. All rights reserved.
이 사이트는 리눅스에서 firefox 기준으로 작성되었습니다. 기타 브라우저에서는 다르게 보일 수 있습니다.
[ Ubuntu + GoLang + PostgreSQL + Mariadb ]
서버위치 : 오라클 클라우드 춘천  실행시간 : 0.08709
to webmaster... gogo sea. gogo sea.